package com.example.demo.mapper;

import com.example.demo.dto.SearchInfo;
import com.example.demo.entity.Bumen;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository()
public interface Bumen_Mapper extends BaseMapper<Bumen>{
	
	@Select("SELECT Bumen.* "
	        + "FROM Bumen  ${where} ${limitstr}")
	public List<Bumen> select(SearchInfo info);
	
	@Select("SELECT COUNT(1) FROM Bumen ${where}")
	public long selectCount(SearchInfo info);
	
	@Insert("INSERT INTO Bumen ( bumenmingcheng) VALUES (  #{bumenmingcheng})")
	public void insert(Bumen bumenmingcheng);
	
	@Update("UPDATE Bumen SET  "
	        + " bumenmingcheng = #{bumenmingcheng} WHERE id = #{id}")
	public void update(Bumen bumenmingcheng);
	
	
	@Delete("DELETE FROM Bumen WHERE id = #{id}")
	public void delete(int id);
	
	@Select("SELECT * FROM Bumen WHERE id = #{id}")
	public Bumen selectById(int id);
	
}
